<?php
namespace app\model;

class ScriptDialogue extends BaseModel
{
    protected $name = 'script_dialogue';
    
    protected $autoWriteTimestamp = true;
    
    protected $type = [
        'create_time' => 'integer',
        'update_time' => 'integer',
        'delete_time' => 'integer'
    ];

    // 对话角色常量
    const ROLE_USER = 'USER';
    const ROLE_AI = 'AI';

    // 内容类型常量
    const TYPE_EXPLAIN = 'EXPLAIN';
    const TYPE_QUESTION = 'QUESTION';
    const TYPE_ANSWER = 'ANSWER';
    const TYPE_EXTEND = 'EXTEND';
    const TYPE_CHAT = 'CHAT';

    /**
     * 关联剧本
     */
    public function script()
    {
        return $this->belongsTo(ScriptInfo::class, 'script_id');
    }
} 